#include <cstdio>
using namespace std;

#define ARRAY_LENGTH 4
#define STR_LENGTH 20

void print_array(char(*)[STR_LENGTH], int, int);

int main()
{
    char str_array[ARRAY_LENGTH][STR_LENGTH];
    int num = 0, first = 0;
    scanf("%d", &num);
    for (int i = 0; i < num; i++) {
        if (i < ARRAY_LENGTH) {
            scanf("%s", str_array[i]);
        } else {
            scanf("%s", str_array[i % ARRAY_LENGTH]);
            first = (i + 1) % ARRAY_LENGTH;
        }
        print_array(str_array, first, i);
    }
}

void print_array(char(* str_array)[STR_LENGTH], int first, int num)
{
    int times = num + 1;
    if (times > ARRAY_LENGTH)
        times = ARRAY_LENGTH;

    first += ARRAY_LENGTH;
    int pos;
    for (int i = 0; i < times; i++) {
        if (num < ARRAY_LENGTH)
            pos = num - i;
        else
            pos = (first - i - 1) % ARRAY_LENGTH;

        if (i < times - 1) 
            printf("%d=%s ", i + 1, str_array[pos]);
        else
            printf("%d=%s", i + 1, str_array[pos]);
    }
    printf("\n");
}